﻿using JavaDevToys.Rcl.Models;

namespace JavaDevToys.Rcl.Service
{
    public interface IJavaCodeGenerator
    {
        public List<string> GenerateModel(JavaProjectInfo javaProjectInfo, ApiInfo _apiInfo);
        /// <summary>
        /// 生成dto代码
        /// </summary>
        /// <param name="javaProjectInfo"></param>
        /// <param name="_apiInfo"></param>
        /// <param name="newFileList">不存在的dto类生成文件</param>
        /// <param name="fixCodeDict">存在的dto类生成需要更新的代码</param>
        public void GenerateDtoModel(JavaProjectInfo javaProjectInfo, ApiInfo _apiInfo,out List<string> newFileList,out Dictionary<string, string> fixCodeDict);
        public List<string> GenerateService(JavaProjectInfo javaProjectInfo, List<JavaServiceInfo> javaServiceInfos);
        /// <summary>
        /// 生成controller
        /// </summary>
        /// <param name="javaProjectInfo"></param>
        /// <param name="javaServiceInfos"></param>
        /// <returns></returns>
        public Dictionary<string, string> GenerateController(JavaProjectInfo javaProjectInfo, List<JavaServiceInfo> javaServiceInfos);
        public Dictionary<string, string> GenerateControllerMethod(JavaProjectInfo javaProjectInfo, List<JavaServiceInfo> javaServiceInfos);
        /// <summary>
        /// 生成work
        /// </summary>
        /// <param name="javaProjectInfo"></param>
        /// <param name="javaServiceInfos"></param>
        /// <returns></returns>
        public Dictionary<string, string> GenerateWork(JavaProjectInfo javaProjectInfo, List<JavaServiceInfo> javaServiceInfos);
        public Dictionary<string, string> GenerateWorkMethod(JavaProjectInfo javaProjectInfo, List<JavaServiceInfo> javaServiceInfos);
        /// <summary>
        /// 生成workImpl
        /// </summary>
        /// <param name="javaProjectInfo"></param>
        /// <param name="javaServiceInfos"></param>
        /// <returns></returns>
        public Dictionary<string, string> GenerateWorkImpl(JavaProjectInfo javaProjectInfo, List<JavaServiceInfo> javaServiceInfos);
        public Dictionary<string, string> GenerateWorkImplMethod(JavaProjectInfo javaProjectInfo, List<JavaServiceInfo> javaServiceInfos);

        /// <summary>
        /// 检查是否已经有文件生成了
        /// </summary>
        /// <param name="javaProjectInfo"></param>
        /// <param name="javaServiceInfos"></param>
        /// <returns></returns>
        public bool CheckFiledExists(JavaProjectInfo javaProjectInfo, List<JavaServiceInfo> javaServiceInfos,out string filePath);
        public List<string> GenerateMapper(JavaProjectInfo javaProjectInfo, JavaMapperInfo javaMapperInfo);
        public List<string> GenerateEnum(JavaProjectInfo javaProjectInfo, IEnumerable<DictCodeSystem> selectedDictCodeSystems, IEnumerable<DictDataSets> dictDataSets, string selectedFolder=null);
        public string GenerateEnumCode(IEnumerable<DictDataSets> dictDataSets);
        public string GenerateParameter(List<ParameterInfo> parameterInfos);
        public string GenerateCSharpParameter(List<ParameterInfo> parameterInfos);
    }
}